var phoneWidth = parseInt(window.screen.width),
    phoneScale = phoneWidth / 750,
    ua = navigator.userAgent,
    isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),
    isWechat = window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger';

if(!isMobile) {
    window.location.href = "../pc/index.shtml" + location.search;
}

if (/Android (\d+\.\d+)/.test(ua)) {
    var version = parseFloat(RegExp.$1);
    if (version > 2.3) {
        document.write('<meta name="viewport" content="width=750, minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
    } else {
        document.write('<meta name="viewport" content="width=750, target-densitydpi=device-dpi">');
    }
} else {
    document.write('<meta name="viewport" content="width=750, user-scalable=no, target-densitydpi=device-dpi">');
}

var deviceWidth = document.documentElement.clientWidth;
if(deviceWidth > 750){
    deviceWidth = 750
}
document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';